﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MyPoints"
        x:Class="MyPoints.MainWindow"
        xmlns:eng="clr-namespace:MyPoints.UserControls" 
        mc:Ignorable="d"
        Title="MainWindow" Height="500" Width="700" FontFamily="Museo 300" Icon="planet.ico" Background="LightGray">
  <Window.Resources>
    <Style TargetType="Button">
      <Setter Property="Width" Value="24" />
      <Setter Property="Height" Value="24" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="Margin" Value="0 0 4 0" />
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
              <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                    Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
            </Border>
            <ControlTemplate.Triggers>
              <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="Blue" />
                <Setter Property="Cursor" Value="Hand" />
                <!-- If we don't tell the background to change on hover, it will remain the same -->
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <ImageBrush x:Key="iconNew" ImageSource=".\Imgs\Icons\new.png" />
    <ImageBrush x:Key="iconOpen" ImageSource=".\Imgs\Icons\open.png" />
    <ImageBrush x:Key="iconSave" ImageSource=".\Imgs\Icons\save.png" />
    <ImageBrush x:Key="iconAdd" ImageSource=".\Imgs\Icons\add.png" />
    <ImageBrush x:Key="iconRemove" ImageSource=".\Imgs\Icons\remove.png" />
    <ImageBrush x:Key="iconStretchToAll" ImageSource=".\Imgs\Icons\stretchToAll.png" />
    <ImageBrush x:Key="iconSettings" ImageSource=".\Imgs\Icons\settings.png" />
    <ImageBrush x:Key="iconAbout" ImageSource=".\Imgs\Icons\info.png" />
  </Window.Resources>
  <DockPanel LastChildFill="True">
    <DockPanel DockPanel.Dock="Top" LastChildFill="True">
      <WrapPanel x:Name="pnlMenu" DockPanel.Dock="Left" Margin="4, 4">
        <Button Background="{StaticResource iconNew}" ToolTip="New" Click="btnNew_Click" />
        <Button Background="{StaticResource iconOpen}" ToolTip="Open" Click="btnOpen_Click" />
        <Button Background="{StaticResource iconSave}" ToolTip="Save" Click="btnSave_Click" />
        <Image Width="10" />
        <Button x:Name="btnNewMarker" Background="{StaticResource iconAdd}" ToolTip="New point" Click="btnNewMarker_Click"/>
        <Button x:Name="btnDeleteMarker" Background="{StaticResource iconRemove}" ToolTip="Delete selected point" Click="btnDeleteMarker_Click"/>
        <Image Width="10" />
        <Button x:Name="btnStretch" Background="{StaticResource iconStretchToAll}" ToolTip="Center to points on map" Click="btnStretch_Click" />
        <Image Width="10" />
        <Button x:Name="btnSettings" Background="{StaticResource iconSettings}" ToolTip="Opens settings file in editor" Click="btnSettings_Click" />
        <Button x:Name="btnAbout" Background="{StaticResource iconAbout}" ToolTip="Opens About window..." Click="btnAbout_Click" />
      </WrapPanel>
      <eng:FilterControl DockPanel.Dock="Right" x:Name="ctrFilter" FilterSet="ctrFilter_FilterSet" />
      <Label />
    </DockPanel>
    <DockPanel LastChildFill="True" DockPanel.Dock="Left" Width="200">
      <WrapPanel x:Name="pnlWptMenu" DockPanel.Dock="Top" Margin="4, 4">
        <!-- tady budou tlačítka markerů -->
      </WrapPanel>
      <eng:WptList x:Name="ctrWptList" />
    </DockPanel>
    <eng:WptDetail x:Name="ctrWptDetail" DockPanel.Dock="Right" Visibility="Collapsed" />
    <eng:Map x:Name="ctrMap" />
  </DockPanel>
</Window>
